3.75 \(\int \frac {(2-3 x+x^2) (d+e x+f x^2)}{4-5 x^2+x^4} \, dx\)

Optimal. Leaf size=29 \[ \log (x+1) (d-e+f)-\log (x+2) (d-2 e+4 f)+f x \]

[Out]

f*x+(d-e+f)*ln(1+x)-(d-2*e+4*f)*ln(2+x)

________________________________________________________________________________________

Rubi [A]  time = 0.05, antiderivative size = 29, normalized size of antiderivative = 1.00, number of steps used = 6, number of rules used = 4, integrand size = 31, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.129, Rules used = {1586, 1657, 632, 31} \[ \log (x+1) (d-e+f)-\log (x+2) (d-2 e+4 f)+f x \]

Antiderivative was successfully verified.

[In]

Int[((2 - 3*x + x^2)*(d + e*x + f*x^2))/(4 - 5*x^2 + x^4),x]

[Out]

f*x + (d - e + f)*Log[1 + x] - (d - 2*e + 4*f)*Log[2 + x]

Rule 31

Int[((a_) + (b_.)*(x_))^(-1), x_Symbol] :> Simp[Log[RemoveContent[a + b*x, x]]/b, x] /; FreeQ[{a, b}, x]

Rule 632

Int[((d_.) + (e_.)*(x_))/((a_) + (b_.)*(x_) + (c_.)*(x_)^2), x_Symbol] :> With[{q = Rt[b^2 - 4*a*c, 2]}, Dist[
(c*d - e*(b/2 - q/2))/q, Int[1/(b/2 - q/2 + c*x), x], x] - Dist[(c*d - e*(b/2 + q/2))/q, Int[1/(b/2 + q/2 + c*
x), x], x]] /; FreeQ[{a, b, c, d, e}, x] && NeQ[2*c*d - b*e, 0] && NeQ[b^2 - 4*a*c, 0] && NiceSqrtQ[b^2 - 4*a*
c]

Rule 1586

Int[(u_.)*(Px_)^(p_.)*(Qx_)^(q_.), x_Symbol] :> Int[u*PolynomialQuotient[Px, Qx, x]^p*Qx^(p + q), x] /; FreeQ[
q, x] && PolyQ[Px, x] && PolyQ[Qx, x] && EqQ[PolynomialRemainder[Px, Qx, x], 0] && IntegerQ[p] && LtQ[p*q, 0]

Rule 1657

Int[(Pq_)*((a_) + (b_.)*(x_) + (c_.)*(x_)^2)^(p_.), x_Symbol] :> Int[ExpandIntegrand[Pq*(a + b*x + c*x^2)^p, x
], x] /; FreeQ[{a, b, c}, x] && PolyQ[Pq, x] && IGtQ[p, -2]

Rubi steps

\begin {align*} \int \frac {\left (2-3 x+x^2\right ) \left (d+e x+f x^2\right )}{4-5 x^2+x^4} \, dx &=\int \frac {d+e x+f x^2}{2+3 x+x^2} \, dx\\ &=\int \left (f+\frac {d-2 f+(e-3 f) x}{2+3 x+x^2}\right ) \, dx\\ &=f x+\int \frac {d-2 f+(e-3 f) x}{2+3 x+x^2} \, dx\\ &=f x+(d-e+f) \int \frac {1}{1+x} \, dx-(d-2 e+4 f) \int \frac {1}{2+x} \, dx\\ &=f x+(d-e+f) \log (1+x)-(d-2 e+4 f) \log (2+x)\\ \end {align*}

________________________________________________________________________________________

Mathematica [A]  time = 0.01, size = 30, normalized size = 1.03 \[ \log (x+1) (d-e+f)+\log (x+2) (-d+2 e-4 f)+f x \]

Antiderivative was successfully verified.

[In]

Integrate[((2 - 3*x + x^2)*(d + e*x + f*x^2))/(4 - 5*x^2 + x^4),x]

[Out]

f*x + (d - e + f)*Log[1 + x] + (-d + 2*e - 4*f)*Log[2 + x]

________________________________________________________________________________________

fricas [A]  time = 0.95, size = 29, normalized size = 1.00 \[ f x - {\left (d - 2 \, e + 4 \, f\right )} \log \left (x + 2\right ) + {\left (d - e + f\right )} \log \left (x + 1\right ) \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((x^2-3*x+2)*(f*x^2+e*x+d)/(x^4-5*x^2+4),x, algorithm="fricas")

[Out]

f*x - (d - 2*e + 4*f)*log(x + 2) + (d - e + f)*log(x + 1)

________________________________________________________________________________________

giac [A]  time = 0.25, size = 33, normalized size = 1.14 \[ f x - {\left (d + 4 \, f - 2 \, e\right )} \log \left ({\left | x + 2 \right |}\right ) + {\left (d + f - e\right )} \log \left ({\left | x + 1 \right |}\right ) \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((x^2-3*x+2)*(f*x^2+e*x+d)/(x^4-5*x^2+4),x, algorithm="giac")

[Out]

f*x - (d + 4*f - 2*e)*log(abs(x + 2)) + (d + f - e)*log(abs(x + 1))

________________________________________________________________________________________

maple [A]  time = 0.01, size = 45, normalized size = 1.55 \[ -d \ln \left (x +2\right )+d \ln \left (x +1\right )+2 e \ln \left (x +2\right )-e \ln \left (x +1\right )+f x -4 f \ln \left (x +2\right )+f \ln \left (x +1\right ) \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

int((x^2-3*x+2)*(f*x^2+e*x+d)/(x^4-5*x^2+4),x)

[Out]

f*x+d*ln(x+1)-e*ln(x+1)+f*ln(x+1)-d*ln(x+2)+2*e*ln(x+2)-4*f*ln(x+2)

________________________________________________________________________________________

maxima [A]  time = 0.43, size = 29, normalized size = 1.00 \[ f x - {\left (d - 2 \, e + 4 \, f\right )} \log \left (x + 2\right ) + {\left (d - e + f\right )} \log \left (x + 1\right ) \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((x^2-3*x+2)*(f*x^2+e*x+d)/(x^4-5*x^2+4),x, algorithm="maxima")

[Out]

f*x - (d - 2*e + 4*f)*log(x + 2) + (d - e + f)*log(x + 1)

________________________________________________________________________________________

mupad [B]  time = 0.07, size = 29, normalized size = 1.00 \[ f\,x+\ln \left (x+1\right )\,\left (d-e+f\right )-\ln \left (x+2\right )\,\left (d-2\,e+4\,f\right ) \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(((x^2 - 3*x + 2)*(d + e*x + f*x^2))/(x^4 - 5*x^2 + 4),x)

[Out]

f*x + log(x + 1)*(d - e + f) - log(x + 2)*(d - 2*e + 4*f)

________________________________________________________________________________________

sympy [A]  time = 0.51, size = 44, normalized size = 1.52 \[ f x + \left (- d + 2 e - 4 f\right ) \log {\left (x + \frac {4 d - 6 e + 10 f}{2 d - 3 e + 5 f} \right )} + \left (d - e + f\right ) \log {\left (x + 1 \right )} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((x**2-3*x+2)*(f*x**2+e*x+d)/(x**4-5*x**2+4),x)

[Out]

f*x + (-d + 2*e - 4*f)*log(x + (4*d - 6*e + 10*f)/(2*d - 3*e + 5*f)) + (d - e + f)*log(x + 1)

________________________________________________________________________________________